﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BanHangCshap.Class
{
    class DonDatHangCT:Database
    {
        #region ***** Fields & Properties ***** 
		private string _maddh;
		public string maddh
		{ 
			get 
			{ 
				return _maddh;
			}
			set 
			{ 
				_maddh = value;
			}
		}
		private string _mahang;
		public string mahang
		{ 
			get 
			{ 
				return _mahang;
			}
			set 
			{ 
				_mahang = value;
			}
		}
		private string _dvt;
		public string dvt
		{ 
			get 
			{ 
				return _dvt;
			}
			set 
			{ 
				_dvt = value;
			}
		}
		private double _dgdathang;
		public double dgdathang
		{ 
			get 
			{ 
				return _dgdathang;
			}
			set 
			{ 
				_dgdathang = value;
			}
		}
		private int _sldathang;
		public int sldathang
		{ 
			get 
			{ 
				return _sldathang;
			}
			set 
			{ 
				_sldathang = value;
			}
		}
		private double _thanhtien;
		public double thanhtien
		{ 
			get 
			{ 
				return _thanhtien;
			}
			set 
			{ 
				_thanhtien = value;
			}
		}
		private double _chietkhau;
		public double chietkhau
		{ 
			get 
			{ 
				return _chietkhau;
			}
			set 
			{ 
				_chietkhau = value;
			}
		}
		private double _thanhtienchietkhau;
		public double thanhtienchietkhau
		{ 
			get 
			{ 
				return _thanhtienchietkhau;
			}
			set 
			{ 
				_thanhtienchietkhau = value;
			}
		}
		private double _thue;
		public double thue
		{ 
			get 
			{ 
				return _thue;
			}
			set 
			{ 
				_thue = value;
			}
		}
		private double _thanhtienthue;
		public double thanhtienthue
		{ 
			get 
			{ 
				return _thanhtienthue;
			}
			set 
			{ 
				_thanhtienthue = value;
			}
		}
       
		private int _sldagiao;
		public int sldagiao
		{ 
			get 
			{ 
				return _sldagiao;
			}
			set 
			{ 
				_sldagiao = value;
			}
		}
		
		
		#endregion

		#region ***** Init Methods ***** 
		public DonDatHangCT()
		{
		}
		public DonDatHangCT(string maddh)
		{
			this.maddh = maddh;
		}
		public DonDatHangCT(string maddh, string mahang, string dvt, double dgdathang, int sldathang, double thanhtien, double chietkhau, double thanhtienchietkhau, double thue, double thanhtienthue, int sldagiao)
		{
			this.maddh = maddh;
			this.mahang = mahang;
			this.dvt = dvt;
			this.dgdathang = dgdathang;
			this.sldathang = sldathang;
			this.thanhtien = thanhtien;
			this.chietkhau = chietkhau;
			this.thanhtienchietkhau = thanhtienchietkhau;
			this.thue = thue;
			this.thanhtienthue = thanhtienthue;
			this.sldagiao = sldagiao;
           
			
		}
        public Boolean themDonDatHangCT()
        {
            string sql = "insert into DonDatHangCT(maddh, mahang,dvt,dgdathang,sldathang,thanhtien,chietkhau,thanhtienchietkhau,thue,thanhtienthue,sldagiao) ";
            sql += " values ('" + maddh + "', '" + mahang + "',N'" + dvt + "'," + dgdathang + "," + sldathang + "," + thanhtien + "," + chietkhau + "," + thanhtienchietkhau + "," + thue + ", " + thanhtienthue + "," + sldagiao + ")";
            return executeQueryTrans(sql);
        }
		#endregion


    }
}
